home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Pictures / TIFF / Tiff Utilties / Tiff Window DEMO / activate.c < prev    next >
C/C++ Source or Header  |  1990-03-20  |  1KB  |  42 lines

  1. #include "my color.h"
  2.  
  3. do_activate(an_event)
  4. EventRecord    *an_event;
  5. {
  6. CWindowPeek        peek;
  7. ControlHandle    control;
  8.  
  9.     peek = (CWindowPeek)an_event->message;
  10.     if (an_event->modifiers & 01) 
  11.     {            /*application window is becoming active*/
  12.         SetPort((CGrafPtr)an_event->message);
  13.         SelectWindow((CWindowPtr)an_event->message);
  14.         EnableItem (myMenus[fileM],closeItem);
  15.         DisableItem(myMenus[editM],undoItem);
  16.         control = peek->controlList;
  17.         while(control)
  18.         {
  19.             ShowControl(control);
  20.             control = (*control)->nextControl;
  21.         }                                    
  22.         DrawGrowIcon((CWindowPtr)an_event->message);
  23.     }    /*if an_event->modifiers*/
  24.     else    /*application window is becoming inactive*/
  25.     {
  26.         if (((CWindowPeek)FrontWindow())->windowKind > 0)
  27.         {
  28.             control = peek->controlList;
  29.             while(control)
  30.             {
  31.                 HideControl(control);
  32.                 control = (*control)->nextControl;
  33.             }                                    
  34.             DrawGrowIcon((CWindowPtr)an_event->message);
  35.             EnableItem (myMenus[editM], undoItem);
  36.             scrapErr = ZeroScrap(); 
  37.         }/*if WindowPeek*/
  38.         else 
  39.             DisableItem (myMenus[editM], undoItem);
  40.     } /*else*/
  41. }
  42.